﻿CREATE TABLE [jcms_module_article] (
	[Id] [int] IDENTITY (1, 1) NOT NULL ,
	[ChannelId] [int] NOT NULL DEFAULT(0) ,
	[ClassId] [int] NOT NULL DEFAULT(0) ,
	[Title] [nvarchar] (150) NOT NULL ,
	[TColor] [nvarchar] (8) NULL ,
	[AddDate] [datetime] NOT NULL DEFAULT (getdate()),
	[Summary] [ntext] NOT NULL DEFAULT ('') ,
	[Editor] [nvarchar] (20) NOT NULL DEFAULT (''),
	[Author] [nvarchar] (30) NOT NULL DEFAULT (''),
	[Tags] [nvarchar] (60) NOT NULL DEFAULT (''),
	[ViewNum] [int] NOT NULL DEFAULT(0) ,
	[IsPass] [int] NOT NULL ,
	[IsImg] [int] NOT NULL DEFAULT(0) ,
	[Img] [nvarchar] (150) NOT NULL DEFAULT (''),
	[IsTop] [int] NOT NULL DEFAULT(0) ,
	[Correlation] [nvarchar] (100) NOT NULL DEFAULT (''),
	[UserId] [int] NOT NULL DEFAULT(0) ,
	[ReadGroup] [int] NOT NULL DEFAULT(0) ,
	[SourceFrom] [nvarchar] (30) NOT NULL DEFAULT (''),
	[Content] [ntext] NOT NULL ,
	[OutUrl] [nvarchar] (100) NULL ,
	CONSTRAINT [PK_module_article] PRIMARY KEY CLUSTERED 
	(
		[Id]
	) ON [PRIMARY] 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [jcms_module_article_collitem] (
	[Id] [int] IDENTITY (1, 1) NOT NULL ,
	[Title] [nvarchar] (50) NOT NULL ,
	[ChannelId] [int] NOT NULL DEFAULT(0) ,
	[ClassId] [int] NOT NULL DEFAULT(0) ,
	[WebName] [nvarchar] (50) NULL ,
	[WebUrl] [nvarchar] (100) NULL ,
	[ItemDemo] [nvarchar] (200) NULL ,
	[ListStr] [nvarchar] (200) NULL ,
	[LsString] [ntext] NULL ,
	[LoString] [ntext] NULL ,
	[HsString] [ntext] NULL ,
	[HoString] [ntext] NULL ,
	[TsString] [ntext] NULL ,
	[ToString] [ntext] NULL ,
	[CsString] [ntext] NULL ,
	[CoString] [ntext] NULL ,
	[NPsString] [ntext] NULL ,
	[NPoString] [ntext] NULL ,
	[AuthorStr] [nvarchar] (50) NULL ,
	[SourceFrom] [nvarchar] (30) NOT NULL DEFAULT (''),
	[Flag] [int] NOT NULL DEFAULT(0) ,
	[Script_Iframe] [int] NOT NULL DEFAULT(0) ,
	[Script_Object] [int] NOT NULL DEFAULT(0) ,
	[Script_Script] [int] NOT NULL DEFAULT(0) ,
	[Script_Div] [int] NOT NULL DEFAULT(0) ,
	[Script_Table] [int] NOT NULL DEFAULT(0) ,
	[Script_Span] [int] NOT NULL DEFAULT(0) ,
	[Script_Img] [int] NOT NULL DEFAULT(0) ,
	[Script_Font] [int] NOT NULL DEFAULT(0) ,
	[Script_A] [int] NOT NULL DEFAULT(0) ,
	[Script_Html] [int] NOT NULL DEFAULT(0) ,
	[CollecNewsNum] [int] NOT NULL DEFAULT(0) ,
	[SaveFiles] [int] NOT NULL DEFAULT(0) ,
	[CollecOrder] [int] NOT NULL DEFAULT(0) ,
	[ListWebEncode] [nvarchar] (50) NULL ,
	[ContentWebEncode] [nvarchar] (50) NULL ,
	CONSTRAINT [PK_module_article_collitem] PRIMARY KEY  CLUSTERED 
	(
		[Id]
	)  ON [PRIMARY] 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [jcms_module_article_collfilters] (
	[Id] [int] IDENTITY (1, 1) NOT NULL ,
	[ChannelId] [int] NOT NULL DEFAULT(0) ,
	[ItemId] [int] NOT NULL DEFAULT(0) ,
	[Title] [nvarchar] (50) NULL ,
	[Filter_Object] [int] NOT NULL DEFAULT(0) ,
	[Filter_Type] [int] NOT NULL DEFAULT(0) ,
	[Filter_Content] [ntext] NULL ,
	[FisString] [ntext] NULL ,
	[FioString] [ntext] NULL ,
	[Filter_Rep] [ntext] NULL ,
	[Flag] [int] NOT NULL DEFAULT(0) ,
	[PublicTf] [int] NOT NULL DEFAULT(0) ,
	CONSTRAINT [PK_module_article_collfilters] PRIMARY KEY  CLUSTERED 
	(
		[Id]
	)  ON [PRIMARY] 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO


CREATE TABLE [jcms_module_article_collhistory] (
	[Id] [int] IDENTITY (1, 1) NOT NULL ,
	[ChannelId] [int] NOT NULL DEFAULT(0) ,
	[ItemId] [int] NOT NULL DEFAULT(0) ,
	[Title] [nvarchar] (100) NULL ,
	[CollectDate] [datetime] NULL ,
	[NewsUrl] [nvarchar] (200) NULL ,
	[ResultStr] [nvarchar] (200) NULL ,
	[Result] [int] NOT NULL DEFAULT(0) ,
	CONSTRAINT [PK_module_article_collhistory] PRIMARY KEY  CLUSTERED 
	(
		[Id]
	)  ON [PRIMARY] 
) ON [PRIMARY]
GO

CREATE TABLE [jcms_module_photo] (
	[Id] [int] IDENTITY (1, 1) NOT NULL ,
	[ChannelId] [int] NOT NULL DEFAULT(0) ,
	[ClassId] [int] NOT NULL DEFAULT(0) ,
	[Title] [nvarchar] (150) NOT NULL ,
	[TColor] [nvarchar] (50) NOT NULL DEFAULT (''),
	[AddDate] [datetime] NOT NULL DEFAULT (getdate()),
	[Summary] [ntext] NOT NULL DEFAULT ('') ,
	[Editor] [nvarchar] (20) NOT NULL DEFAULT (''),
	[Author] [nvarchar] (30) NOT NULL DEFAULT (''),
	[Tags] [nvarchar] (60) NOT NULL DEFAULT (''),
	[ViewNum] [int] NOT NULL DEFAULT(0) ,
	[IsPass] [int] NOT NULL ,
	[IsImg] [int] NOT NULL DEFAULT(0) ,
	[Img] [nvarchar] (150) NOT NULL DEFAULT (''),
	[IsTop] [int] NOT NULL DEFAULT(0) ,
	[Correlation] [nvarchar] (100) NOT NULL DEFAULT (''),
	[UserId] [int] NOT NULL DEFAULT(0) ,
	[ReadGroup] [int] NOT NULL DEFAULT(0) ,
	[SourceFrom] [nvarchar] (30) NOT NULL DEFAULT (''),
	[PhotoUrl] [ntext] NOT NULL DEFAULT ('') ,
	[PageSize] [int] NOT NULL DEFAULT(0) ,
	[OutUrl] [nvarchar] (100) NULL ,
	CONSTRAINT [PK_module_photo] PRIMARY KEY CLUSTERED 
	(
		[Id]
	) ON [PRIMARY] 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [jcms_module_soft] (
	[Id] [int] IDENTITY (1, 1) NOT NULL ,
	[ChannelId] [int] NOT NULL DEFAULT(0) ,
	[ClassId] [int] NOT NULL DEFAULT(0) ,
	[Title] [nvarchar] (150) NOT NULL ,
	[TColor] [nvarchar] (50) NOT NULL DEFAULT (''),
	[AddDate] [datetime] NOT NULL DEFAULT (getdate()),
	[Summary] [ntext] NOT NULL DEFAULT ('') ,
	[Editor] [nvarchar] (20) NOT NULL DEFAULT (''),
	[Author] [nvarchar] (30) NOT NULL DEFAULT (''),
	[Tags] [nvarchar] (60) NOT NULL DEFAULT (''),
	[ViewNum] [int] NOT NULL DEFAULT(0) ,
	[IsPass] [int] NOT NULL ,
	[IsImg] [int] NOT NULL DEFAULT(0) ,
	[Img] [nvarchar] (150) NOT NULL DEFAULT (''),
	[IsTop] [int] NOT NULL DEFAULT(0) ,
	[Correlation] [nvarchar] (100) NOT NULL DEFAULT (''),
	[UserId] [int] NOT NULL DEFAULT(0) ,
	[ReadGroup] [int] NOT NULL DEFAULT(0) ,
	[SourceFrom] [nvarchar] (30) NOT NULL DEFAULT (''),
	[Version] [nvarchar] (100) NOT NULL DEFAULT (''),
	[OperatingSystem] [nvarchar] (255) NULL ,
	[UnZipPass] [nvarchar] (100) NOT NULL DEFAULT (''),
	[DemoUrl] [nvarchar] (255) NULL ,
	[RegUrl] [nvarchar] (255) NULL ,
	[SSize] [varchar] (20) NULL ,
	[Points] [int] NOT NULL DEFAULT(0) ,
	[DownUrl] [ntext] NOT NULL DEFAULT ('') ,
	[DownNum] [int] NOT NULL DEFAULT(0) ,
	[OutUrl] [nvarchar] (100) NULL ,
	CONSTRAINT [PK_module_soft] PRIMARY KEY CLUSTERED 
	(
		[Id]
	) ON [PRIMARY] 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO


CREATE TABLE [jcms_module_soft_downlogs] (
	[Id] [bigint] IDENTITY (1, 1) NOT NULL ,
	[ChannelId] [int] NOT NULL DEFAULT(0) ,
	[UserId] [int] NOT NULL DEFAULT(0) ,
	[SoftId] [int] NOT NULL DEFAULT(0) ,
	[Points] [int] NOT NULL DEFAULT(0) ,
	[DownTime] [datetime] NOT NULL DEFAULT (getdate()),
	[DownIP] [nvarchar] (16) NULL ,
	[DownDegree] [int] NOT NULL DEFAULT(0) ,
	CONSTRAINT [PK_module_soft_downlogs] PRIMARY KEY CLUSTERED 
	(
		[Id]
	) ON [PRIMARY] 
) ON [PRIMARY]
GO


CREATE TABLE [jcms_module_video] (
	[Id] [int] IDENTITY (1, 1) NOT NULL ,
	[ChannelId] [int] NOT NULL DEFAULT(0) ,
	[ClassId] [int] NOT NULL DEFAULT(0) ,
	[Title] [nvarchar] (150) NOT NULL ,
	[TColor] [nvarchar] (50) NOT NULL DEFAULT (''),
	[AddDate] [datetime] NOT NULL DEFAULT (getdate()),
	[Summary] [ntext] NOT NULL DEFAULT ('') ,
	[Editor] [nvarchar] (20) NOT NULL DEFAULT (''),
	[Author] [nvarchar] (30) NOT NULL DEFAULT (''),
	[Tags] [nvarchar] (60) NOT NULL DEFAULT (''),
	[ViewNum] [int] NOT NULL DEFAULT(0) ,
	[IsPass] [int] NOT NULL ,
	[IsImg] [int] NOT NULL DEFAULT(0) ,
	[Img] [nvarchar] (150) NOT NULL DEFAULT (''),
	[IsTop] [int] NOT NULL DEFAULT(0) ,
	[Correlation] [nvarchar] (100) NOT NULL DEFAULT (''),
	[UserId] [int] NOT NULL DEFAULT(0) ,
	[ReadGroup] [int] NOT NULL DEFAULT(0) ,
	[SourceFrom] [nvarchar] (30) NOT NULL DEFAULT (''),
	[VideoUrl] [ntext] NOT NULL DEFAULT ('') ,
	[PageSize] [int] NOT NULL DEFAULT(0) ,
	[OutUrl] [nvarchar] (100) NULL ,
	CONSTRAINT [PK_module_video] PRIMARY KEY CLUSTERED 
	(
		[Id]
	) ON [PRIMARY] 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [jcms_normal_adminlogs] (
	[Id] [int] IDENTITY (1, 1) NOT NULL ,
	[AdminId] [int] NOT NULL ,
	[OperInfo] [nvarchar] (200) NOT NULL DEFAULT (''),
	[OperTime] [datetime] NOT NULL DEFAULT (getdate()),
	[OperIP] [nvarchar] (15) NULL ,
	CONSTRAINT [PK_normal_adminlogs] PRIMARY KEY CLUSTERED 
	(
		[Id]
	) ON [PRIMARY] 
) ON [PRIMARY]
GO

CREATE TABLE [jcms_normal_channel] (
	[Id] [int] IDENTITY (1, 1) NOT NULL ,
	[Title] [nvarchar] (20) NOT NULL ,
	[Info] [nvarchar] (200) NOT NULL DEFAULT (''),
	[ClassDepth] [int] NOT NULL DEFAULT(0) ,
	[Dir] [nvarchar] (20) NOT NULL ,
	[pId] [int] NOT NULL DEFAULT(0) ,
	[ItemName] [nvarchar] (10) NOT NULL DEFAULT (''),
	[ItemUnit] [nvarchar] (6) NULL ,
	[TemplateId] [int] NOT NULL DEFAULT(0) ,
	[Type] [nvarchar] (10) NOT NULL DEFAULT (''),
	[IsOut] [int] NOT NULL DEFAULT(0) ,
	[OutUrl] [nvarchar] (100) NOT NULL DEFAULT (''),
	[Target] [int] NOT NULL DEFAULT(0) ,
	[Enabled] [int] NOT NULL DEFAULT(0) ,
	[IsNav] [int] NOT NULL DEFAULT(0) ,
	[DefaultThumbs] [int] NOT NULL DEFAULT(0) ,
	[IsPost] [int] NOT NULL DEFAULT(0) ,
	[IsHtml] [int] NOT NULL DEFAULT(0) ,
	CONSTRAINT [PK_normal_channel] PRIMARY KEY CLUSTERED 
	(
		[Id]
	) ON [PRIMARY] 
) ON [PRIMARY]
GO
INSERT INTO [jcms_normal_channel] (Title,Info,Dir,pId,ItemName,ItemUnit,TemplateId,Type,IsOut,OutUrl,Target,Enabled,IsNav,IsHtml,DefaultThumbs,IsPost,ClassDepth) values('网站首页','','',1,'','',0,'system', 1,'/',0,1,1,0,0,0,1);

CREATE TABLE [jcms_normal_class] (
	[Id] [int] IDENTITY (1, 1) NOT NULL ,
	[ChannelId] [int] NOT NULL ,
	[ParentId] [int] NOT NULL ,
	[Title] [nvarchar] (20) NOT NULL ,
	[Info] [nvarchar] (100) NOT NULL DEFAULT (''),
	[Number] [nvarchar] (10) NOT NULL DEFAULT (''),
	[Code] [nvarchar] (40) NOT NULL DEFAULT (''),
	[IsPost] [int] NOT NULL DEFAULT(0) ,
	[IsTop] [int] NOT NULL DEFAULT(0) ,
	[TopicNum] [int] NOT NULL DEFAULT(0) ,
	[TemplateId] [int] NOT NULL DEFAULT(0) ,
	[ContentTemp] [int] NOT NULL DEFAULT(0) ,
	[PageSize] [int] NOT NULL DEFAULT(0) ,
	[IsOut] [int] NOT NULL DEFAULT(0) ,
	[OutUrl] [nvarchar] (100) NOT NULL DEFAULT (''),
	[ReadGroup] [int] NOT NULL DEFAULT(0) ,
	CONSTRAINT [PK_normal_class] PRIMARY KEY CLUSTERED 
	(
		[Id]
	) ON [PRIMARY] 
) ON [PRIMARY]
GO

CREATE TABLE [jcms_normal_extends] (
	[Id] [int] IDENTITY (1, 1) NOT NULL ,
	[Title] [nvarchar] (20) NOT NULL DEFAULT (''),
	[Name] [nvarchar] (20) NOT NULL DEFAULT (''),
	[Author] [nvarchar] (20) NOT NULL DEFAULT (''),
	[Info] [nvarchar] (50) NOT NULL DEFAULT (''),
	[Type] [int] NOT NULL DEFAULT(0) ,
	[pId] [int] NOT NULL ,
	[BaseTable] [nvarchar] (200) NOT NULL DEFAULT (''),
	[ManageUrl] [nvarchar] (50) NOT NULL DEFAULT (''),
	[CSSData] [ntext] NOT NULL DEFAULT ('') ,
	[JsData] [ntext] NOT NULL DEFAULT ('') ,
	[Enabled] [int] NOT NULL DEFAULT(0) ,
	[Locked] [int] NOT NULL DEFAULT(0) ,
	CONSTRAINT [PK_normal_extends] PRIMARY KEY CLUSTERED 
	(
		[Id]
	) ON [PRIMARY] 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [jcms_normal_forbidip] (
	[Id] [int] IDENTITY (1, 1) NOT NULL ,
	[StartIP] [bigint] NULL ,
	[StartIP2] [nvarchar] (16) NULL ,
	[EndIP] [bigint] NULL ,
	[EndIP2] [nvarchar] (16) NULL ,
	[ExpireDate] [datetime] NOT NULL DEFAULT (getdate()),
	[Enabled] [int] NOT NULL DEFAULT(0) ,
	CONSTRAINT [PK_normal_forbidip] PRIMARY KEY CLUSTERED 
	(
		[Id]
	) ON [PRIMARY]
) ON [PRIMARY]
GO

CREATE TABLE [jcms_normal_javascript] (
	[Id] [int] IDENTITY (1, 1) NOT NULL ,
	[Title] [nvarchar] (50) NOT NULL ,
	[Code] [varchar] (64) NOT NULL DEFAULT (''),
	[ChannelId] [int] NOT NULL DEFAULT(0) ,
	[ClassId] [int] NOT NULL DEFAULT(0) ,
	[SelectNumber] [int] NOT NULL DEFAULT(0) ,
	[TitleLen] [int] NOT NULL DEFAULT(0) ,
	[JumbotLiCode] [varchar] (30) NOT NULL DEFAULT (''),
	CONSTRAINT [PK_normal_javascript] PRIMARY KEY CLUSTERED 
	(
		[Id]
	) ON [PRIMARY] 
) ON [PRIMARY]
GO

CREATE TABLE [jcms_normal_mtag] (
	[Id] [int] IDENTITY (1, 1) NOT NULL ,
	[Title] [nvarchar] (50) NOT NULL DEFAULT (''),
	[Img] [nvarchar] (150) NOT NULL DEFAULT (''),
	[Proclaim] [nvarchar] (200) NOT NULL DEFAULT (''),
	[JoinPower] [int] NOT NULL DEFAULT(0) ,
	[ViewPower] [int] NOT NULL DEFAULT(0) ,
	[CloseApply] [int] NOT NULL DEFAULT(0) ,
	[SortId] [int] NOT NULL DEFAULT(0) ,
	[MemberTotal] [int] NOT NULL DEFAULT(0) ,
	[UpdateTime] [datetime] NOT NULL DEFAULT (getdate()),
	[UserId] [int] NOT NULL DEFAULT(0) ,
	CONSTRAINT [PK_normal_mtag] PRIMARY KEY CLUSTERED 
	(
		[Id]
	) ON [PRIMARY] 
) ON [PRIMARY]
GO

CREATE TABLE [jcms_normal_mtag_member] (
	[Id] [int] IDENTITY (1, 1) NOT NULL ,
	[UserId] [int] NOT NULL ,
	[MTagId] [int] NOT NULL ,
	[Power] [int] NOT NULL DEFAULT(0) ,
	CONSTRAINT [PK_normal_mtag_member] PRIMARY KEY CLUSTERED 
	(
		[Id]
	) ON [PRIMARY] 
) ON [PRIMARY]
GO

CREATE TABLE [jcms_normal_mtag_thread] (
	[Id] [int] IDENTITY (1, 1) NOT NULL ,
	[Title] [nvarchar] (100) NOT NULL DEFAULT (''),
	[Content] [ntext] NOT NULL DEFAULT ('') ,
	[MTagId] [int] NOT NULL ,
	[IsGood] [int] NOT NULL DEFAULT(0) ,
	[IsHead] [int] NOT NULL DEFAULT(0) ,
	[AddTime] [datetime] NOT NULL DEFAULT (getdate()),
	[ReplyCount] [int] NOT NULL DEFAULT(0) ,
	[UserId] [int] NOT NULL DEFAULT(0) ,
	CONSTRAINT [PK_normal_mtag_thread] PRIMARY KEY CLUSTERED 
	(
		[Id]
	) ON [PRIMARY] 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [jcms_normal_mtag_thread_reply] (
	[Id] [int] IDENTITY (1, 1) NOT NULL ,
	[Content] [nvarchar] (1000) NOT NULL DEFAULT (''),
	[MTagId] [int] NOT NULL ,
	[ThreadId] [int] NOT NULL ,
	[AddTime] [datetime] NOT NULL DEFAULT (getdate()),
	[UserId] [int] NOT NULL DEFAULT(0) ,
	CONSTRAINT [PK_normal_mtag_thread_reply] PRIMARY KEY CLUSTERED 
	(
		[Id]
	) ON [PRIMARY] 
) ON [PRIMARY]
GO

CREATE TABLE [jcms_normal_mtag_sort] (
	[Id] [int] IDENTITY (1, 1) NOT NULL ,
	[Title] [nvarchar] (100) NOT NULL DEFAULT (''),
	[Info] [nvarchar] (200) NOT NULL DEFAULT (''),
	[State] [int] NOT NULL DEFAULT(0) ,
	CONSTRAINT [PK_normal_mtag_sort] PRIMARY KEY CLUSTERED 
	(
		[Id]
	) ON [PRIMARY]
) ON [PRIMARY]
GO
INSERT INTO [jcms_normal_mtag_sort] (Title,Info,State) values('自由联盟','自由联盟',1);
INSERT INTO [jcms_normal_mtag_sort] (Title,Info,State) values('兴趣联盟','兴趣联盟',1);
INSERT INTO [jcms_normal_mtag_sort] (Title,Info,State) values('技术交流','技术交流',1);
INSERT INTO [jcms_normal_mtag_sort] (Title,Info,State) values('协同合作','协同合作',1);

CREATE TABLE [jcms_normal_modules] (
	[Id] [int] IDENTITY (1, 1) NOT NULL ,
	[Title] [nvarchar] (100) NOT NULL ,
	[Type] [nvarchar] (10) NOT NULL DEFAULT (''),
	[PId] [int] NOT NULL DEFAULT(0) ,
	[Enabled] [int] NOT NULL DEFAULT(0) ,
	[Locked] [int] NOT NULL DEFAULT(0) ,
	[SearchFieldValues] [nvarchar] (200) NOT NULL DEFAULT (''),
	[SearchFieldTexts] [nvarchar] (200) NULL ,
	CONSTRAINT [PK_normal_modules] PRIMARY KEY CLUSTERED 
	(
		[Id]
	) ON [PRIMARY] 
) ON [PRIMARY]
GO
INSERT INTO [jcms_normal_modules] (Title,Type,pId,Enabled,Locked,SearchFieldValues,SearchFieldTexts) values('文章','article',1,1,1,'title,summary','标题,简介');
INSERT INTO [jcms_normal_modules] (Title,Type,pId,Enabled,Locked,SearchFieldValues,SearchFieldTexts) values('图片','photo',2,1,1,'title,summary','标题,简介');
INSERT INTO [jcms_normal_modules] (Title,Type,pId,Enabled,Locked,SearchFieldValues,SearchFieldTexts) values('下载','soft',3,1,1,'title,summary','标题,简介');
INSERT INTO [jcms_normal_modules] (Title,Type,pId,Enabled,Locked,SearchFieldValues,SearchFieldTexts) values('视频','video',4,1,1,'title,summary','标题,简介');

CREATE TABLE [jcms_normal_page] (
	[Id] [int] IDENTITY (1, 1) NOT NULL ,
	[Title] [nvarchar] (20) NOT NULL DEFAULT (''),
	[SId] [int] NOT NULL DEFAULT(0) ,
	[Source] [nvarchar] (50) NULL ,
	CONSTRAINT [PK_normal_page] PRIMARY KEY CLUSTERED 
	(
		[Id]
	) ON [PRIMARY] 
) ON [PRIMARY]
GO
INSERT INTO [jcms_normal_page] (Title,SId,Source) values('关于我们',1,'index.html')
INSERT INTO [jcms_normal_page] (Title,SId,Source) values('本站服务',1,'service.html')
INSERT INTO [jcms_normal_page] (Title,SId,Source) values('广告合作',1,'adver.html')
INSERT INTO [jcms_normal_page] (Title,SId,Source) values('联系方式',1,'contactus.html')
INSERT INTO [jcms_normal_page] (Title,SId,Source) values('支付方式',1,'payment.html')
INSERT INTO [jcms_normal_page] (Title,SId,Source) values('会员帮助',2,'index.html')

CREATE TABLE [jcms_normal_page_sort] (
	[Id] [int] IDENTITY (1, 1) NOT NULL ,
	[Title] [nvarchar] (20) NOT NULL DEFAULT (''),
	[Info] [nvarchar] (200) NOT NULL DEFAULT (''),
	[Dir] [nvarchar] (50) NULL ,
	CONSTRAINT [PK_normal_page_sort] PRIMARY KEY CLUSTERED 
	(
		[Id]
	) ON [PRIMARY] 
) ON [PRIMARY]
GO
INSERT INTO [jcms_normal_page_sort] (Title,Info,Dir) values('本站介绍','','about')
INSERT INTO [jcms_normal_page_sort] (Title,Info,Dir) values('帮助中心','','help')

CREATE TABLE [jcms_normal_pointscard] (
	[Id] [int] IDENTITY (1, 1) NOT NULL ,
	[CardNumber] [nvarchar] (16) NULL ,
	[CardPassword] [nvarchar] (32) NULL ,
	[UserId] [int] NOT NULL DEFAULT(0) ,
	[Points] [int] NOT NULL,
	[LimitedDate] [datetime] NOT NULL DEFAULT (getdate()),
	[ActiveTime] [datetime] NOT NULL DEFAULT (getdate()),
	[ActiveIP] [nvarchar] (15) NULL ,
	[State] [int] NOT NULL DEFAULT(0) ,
	CONSTRAINT [PK_normal_pointscard] PRIMARY KEY CLUSTERED 
	(
		[Id]
	) ON [PRIMARY] 
) ON [PRIMARY]
GO

CREATE TABLE [jcms_normal_pointscard_sort] (
	[Id] [int] IDENTITY (1, 1) NOT NULL ,
	[Title] [nvarchar] (50) NOT NULL DEFAULT (''),
	[Points] [int] NOT NULL ,
	CONSTRAINT [PK_normal_pointscard_sort] PRIMARY KEY CLUSTERED 
	(
		[Id]
	) ON [PRIMARY] 
) ON [PRIMARY]
GO
INSERT INTO [jcms_normal_pointscard_sort] (Title,Points) values('50元=>50点',50);
INSERT INTO [jcms_normal_pointscard_sort] (Title,Points) values('100元=>100点',100);
INSERT INTO [jcms_normal_pointscard_sort] (Title,Points) values('200元=>200点',200);
INSERT INTO [jcms_normal_pointscard_sort] (Title,Points) values('500元=>500点',500);
INSERT INTO [jcms_normal_pointscard_sort] (Title,Points) values('1000元=>1000点',1000);

CREATE TABLE [jcms_normal_skins] (
	[Id] [int] IDENTITY (1, 1) NOT NULL ,
	[Title] [nvarchar] (30) NOT NULL DEFAULT (''),
	[Source] [nvarchar] (50) NOT NULL DEFAULT (''),
	[BodyWidth] [int] NOT NULL DEFAULT(0) ,
	[LeftWidth] [int] NOT NULL DEFAULT(0) ,
	[RightWidth] [int] NOT NULL DEFAULT(0) ,
	[TitleColor] [nvarchar] (10) NOT NULL DEFAULT (''),
	[BorderColor] [nvarchar] (10) NOT NULL DEFAULT (''),
	[TintBackground] [nvarchar] (10) NOT NULL DEFAULT (''),
	[DarkBackground] [nvarchar] (10) NULL ,
	CONSTRAINT [PK_normal_skins] PRIMARY KEY CLUSTERED 
	(
		[Id]
	) ON [PRIMARY] 
) ON [PRIMARY]
GO
INSERT INTO [jcms_normal_skins] (Title,Source,BodyWidth,LeftWidth,RightWidth,TitleColor,BorderColor,TintBackground,DarkBackground) values('浅蓝色宽屏','blue1002',1002,252,740,'#00599B','#AACCEE','#F4F9FD','#316395');
INSERT INTO [jcms_normal_skins] (Title,Source,BodyWidth,LeftWidth,RightWidth,TitleColor,BorderColor,TintBackground,DarkBackground) values('浅蓝色中屏','blue0912',912,222,680,'#00599B','#AACCEE','#F4F9FD','#316395');
INSERT INTO [jcms_normal_skins] (Title,Source,BodyWidth,LeftWidth,RightWidth,TitleColor,BorderColor,TintBackground,DarkBackground) values('浅蓝色窄屏','blue0788',788,178,600,'#00599B','#AACCEE','#F4F9FD','#316395');



CREATE TABLE [jcms_normal_special] (
	[Id] [int] IDENTITY (1, 1) NOT NULL ,
	[Title] [nvarchar] (100) NOT NULL DEFAULT (''),
	[Info] [nvarchar] (200) NOT NULL DEFAULT (''),
	[Source] [nvarchar] (50) NULL ,
	CONSTRAINT [PK_normal_special] PRIMARY KEY CLUSTERED 
	(
		[Id]
	) ON [PRIMARY] 
) ON [PRIMARY]
GO

CREATE TABLE [jcms_normal_specialcontent] (
	[Id] [int] IDENTITY (1, 1) NOT NULL ,
	[Title] [nvarchar] (100) NOT NULL DEFAULT (''),
	[sId] [int] NOT NULL ,
	[ChannelId] [int] NOT NULL ,
	[ContentId] [int] NOT NULL ,
	CONSTRAINT [PK_normal_specialcontent] PRIMARY KEY CLUSTERED 
	(
		[Id]
	) ON [PRIMARY] 
) ON [PRIMARY]
GO

CREATE TABLE [jcms_normal_system] (
	[Id] [int] IDENTITY (1, 1) NOT NULL ,
	[Info] [nvarchar] (2000) NOT NULL ,
	CONSTRAINT [PK_normal_system] PRIMARY KEY CLUSTERED 
	(
		[Id]
	) ON [PRIMARY] 
) ON [PRIMARY]
GO
INSERT INTO [jcms_normal_system] (Info) Values('网站名称§1§系统正在升级中…§0§0|23§1§1§0§20§http://127.0.0.1§§§1§/§.htm§')

CREATE TABLE [jcms_normal_tag] (
	[Id] [int] IDENTITY (1, 1) NOT NULL ,
	[ChannelId] [int] NOT NULL DEFAULT(0) ,
	[Title] [nvarchar] (15) NOT NULL ,
	[ClickTimes] [int] NOT NULL DEFAULT(0) ,
	CONSTRAINT [PK_normal_tag] PRIMARY KEY CLUSTERED 
	(
		[Id]
	) ON [PRIMARY] 
) ON [PRIMARY]
GO

CREATE TABLE [jcms_normal_template] (
	[Id] [int] IDENTITY (1, 1) NOT NULL ,
	[Title] [nvarchar] (100) NOT NULL DEFAULT (''),
	[PId] [int] NOT NULL DEFAULT(0) ,
	[Type] [nvarchar] (50) NOT NULL DEFAULT (''),
	[SType] [nvarchar] (50) NOT NULL DEFAULT (''),
	[IsDefault] [int] NOT NULL DEFAULT(0) ,
	[Source] [nvarchar] (50) NOT NULL DEFAULT (''),
	[SkinId] [int] NOT NULL DEFAULT(0) ,
	CONSTRAINT [PK_normal_template] PRIMARY KEY CLUSTERED 
	(
		[Id]
	) ON [PRIMARY]
) ON [PRIMARY]
GO
INSERT INTO [jcms_normal_template] (Title,pId,Type,sType,IsDefault,Source,SkinId) values('默认模板站点首页',1,'system','index',1,'system_index.htm',2);
INSERT INTO [jcms_normal_template] (Title,pId,Type,sType,IsDefault,Source,SkinId) values('默认模板文章频道页',1,'article','channel',1,'article_channel.htm',2);
INSERT INTO [jcms_normal_template] (Title,pId,Type,sType,IsDefault,Source,SkinId) values('默认模板文章列表页',1,'article','class',1,'article_class.htm',2);
INSERT INTO [jcms_normal_template] (Title,pId,Type,sType,IsDefault,Source,SkinId) values('默认模板文章内容页',1,'article','content',1,'article_content.htm',2);
INSERT INTO [jcms_normal_template] (Title,pId,Type,sType,IsDefault,Source,SkinId) values('默认模板下载频道页',1,'soft','channel',1,'soft_channel.htm',2);
INSERT INTO [jcms_normal_template] (Title,pId,Type,sType,IsDefault,Source,SkinId) values('默认模板下载列表页',1,'soft','class',1,'soft_class.htm',2);
INSERT INTO [jcms_normal_template] (Title,pId,Type,sType,IsDefault,Source,SkinId) values('默认模板下载内容页',1,'soft','content',1,'soft_content.htm',2);
INSERT INTO [jcms_normal_template] (Title,pId,Type,sType,IsDefault,Source,SkinId) values('默认模板图片频道页',1,'photo','channel',1,'photo_channel.htm',2);
INSERT INTO [jcms_normal_template] (Title,pId,Type,sType,IsDefault,Source,SkinId) values('默认模板图片列表页',1,'photo','class',1,'photo_class.htm',2);
INSERT INTO [jcms_normal_template] (Title,pId,Type,sType,IsDefault,Source,SkinId) values('默认模板图片内容页',1,'photo','content',1,'photo_content.htm',2);
INSERT INTO [jcms_normal_template] (Title,pId,Type,sType,IsDefault,Source,SkinId) values('默认模板视频频道页',1,'video','channel',1,'video_channel.htm',2);
INSERT INTO [jcms_normal_template] (Title,pId,Type,sType,IsDefault,Source,SkinId) values('默认模板视频列表页',1,'video','class',1,'video_class.htm',2);
INSERT INTO [jcms_normal_template] (Title,pId,Type,sType,IsDefault,Source,SkinId) values('默认模板视频内容页',1,'video','content',1,'video_content.htm',2);


CREATE TABLE [jcms_normal_templatecontentli] (
	[Id] [int] IDENTITY (1, 1) NOT NULL ,
	[Title] [nvarchar] (50) NOT NULL ,
	[Code] [varchar] (30) NOT NULL DEFAULT (''),
	[Fields] [text] NOT NULL DEFAULT ('') ,
	[OrderBy] [varchar] (20) NOT NULL DEFAULT (''),
	[IsTop] [int] NOT NULL DEFAULT(0) ,
	[IsImg] [int] NOT NULL DEFAULT(0) ,
	[TitleLen] [int] NOT NULL DEFAULT(0) ,
	[SummaryLen] [int] NOT NULL DEFAULT(0) ,
	[DateFormat] [varchar] (20) NOT NULL DEFAULT (''),
	[Repeat] [text] NOT NULL DEFAULT ('') ,
	[Content] [text] NOT NULL DEFAULT ('') ,
	CONSTRAINT [PK_normal_templatecontentli] PRIMARY KEY CLUSTERED 
	(
		[Id]
	) ON [PRIMARY] 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO


CREATE TABLE [jcms_normal_templatelabel] (
	[Id] [int] IDENTITY (1, 1) NOT NULL ,
	[Title] [nvarchar] (100) NOT NULL DEFAULT (''),
	[Info] [nvarchar] (200) NOT NULL DEFAULT (''),
	[PId] [int] NOT NULL DEFAULT(0) ,
	[Sort] [int] NOT NULL DEFAULT(0) ,
	[Source] [nvarchar] (100) NOT NULL DEFAULT ('') ,
	CONSTRAINT [PK_normal_templatelabel] PRIMARY KEY CLUSTERED 
	(
		[Id]
	) ON [PRIMARY] 
) ON [PRIMARY]
GO

CREATE TABLE [jcms_normal_templateproject] (
	[Id] [int] IDENTITY (1, 1) NOT NULL ,
	[Title] [nvarchar] (100) NOT NULL DEFAULT (''),
	[Info] [nvarchar] (200) NOT NULL DEFAULT (''),
	[Dir] [nvarchar] (50) NOT NULL DEFAULT (''),
	[IsDefault] [int] NOT NULL DEFAULT(0) ,
	CONSTRAINT [PK_normal_templateproject] PRIMARY KEY CLUSTERED 
	(
		[Id]
	) ON [PRIMARY]
) ON [PRIMARY]
GO
INSERT INTO [jcms_normal_templateproject] (Title,Info,Dir,isDefault) values('默认模板','','default',1);


CREATE TABLE [jcms_normal_thumbs] (
	[Id] [int] IDENTITY (1, 1) NOT NULL ,
	[ChannelId] [int] NOT NULL DEFAULT(0) ,
	[Title] [nvarchar] (30) NOT NULL DEFAULT (''),
	[iWidth] [int] NOT NULL DEFAULT(0) ,
	[iHeight] [int] NOT NULL DEFAULT(0) ,
	CONSTRAINT [PK_normal_thumbs] PRIMARY KEY CLUSTERED 
	(
		[Id]
	) ON [PRIMARY]
) ON [PRIMARY]
GO
INSERT INTO [jcms_normal_thumbs] (ChannelId,Title,iWidth,iHeight) Values (0,'360X270',360,270);
INSERT INTO [jcms_normal_thumbs] (ChannelId,Title,iWidth,iHeight) Values (0,'240X180',240,180);
INSERT INTO [jcms_normal_thumbs] (ChannelId,Title,iWidth,iHeight) Values (0,'150X120',150,120);
INSERT INTO [jcms_normal_thumbs] (ChannelId,Title,iWidth,iHeight) Values (0,'128X96',128,96);

CREATE TABLE [jcms_normal_user] (
	[Id] [int] IDENTITY (1, 1) NOT NULL ,
	[UserName] [nvarchar] (20) NOT NULL DEFAULT (''),
	[UserPass] [nvarchar] (40) NOT NULL DEFAULT (''),
	[TrueName] [nvarchar] (20) NOT NULL DEFAULT (''),
	[Question] [nvarchar] (30) NOT NULL DEFAULT (''),
	[Answer] [nvarchar] (20) NOT NULL DEFAULT (''),
	[Sex] [int] NOT NULL ,
	[Email] [nvarchar] (80) NOT NULL DEFAULT (''),
	[Group] [int] NOT NULL DEFAULT(0) ,
	[State] [int] NOT NULL DEFAULT(0) ,
	[Cookies] [nvarchar] (10) NOT NULL DEFAULT (''),
	[RegTime] [datetime] NOT NULL DEFAULT (getdate()),
	[RegIp] [nvarchar] (15) NULL ,
	[LastTime] [datetime] NOT NULL DEFAULT (getdate()),
	[LastIp] [nvarchar] (15) NULL ,
	[HomePage] [nvarchar] (100) NOT NULL DEFAULT (''),
	[QQ] [nvarchar] (50) NOT NULL DEFAULT (''),
	[ICQ] [nvarchar] (50) NOT NULL DEFAULT (''),
	[MSN] [nvarchar] (50) NOT NULL DEFAULT (''),
	[BirthDay] [nvarchar] (50) NOT NULL DEFAULT (''),
	[ComeFrom] [nvarchar] (255) NULL ,
	[Login] [int] NOT NULL DEFAULT(0) ,
	[Points] [int] NOT NULL DEFAULT(0) ,
	[IsWriter] [int] NOT NULL DEFAULT(0) ,
	[IDType] [int] NOT NULL DEFAULT(0) ,
	[IDCard] [nvarchar] (30) NOT NULL DEFAULT (''),
	[WorkUnit] [nvarchar] (100) NOT NULL DEFAULT (''),
	[Address] [nvarchar] (100) NOT NULL DEFAULT (''),
	[ZipCode] [nvarchar] (10) NOT NULL DEFAULT (''),
	[Telephone] [nvarchar] (20) NOT NULL DEFAULT (''),
	[Languages] [nvarchar] (50) NOT NULL DEFAULT (''),
	[StudyWay] [nvarchar] (50) NOT NULL DEFAULT (''),
	[MobileTel] [nvarchar] (11) NULL ,
	[GraduateFrom] [nvarchar] (50) NOT NULL DEFAULT (''),
	[CardUserName] [nvarchar] (20) NOT NULL DEFAULT (''),
	[CardBank] [nvarchar] (50) NOT NULL DEFAULT (''),
	[CardNumber] [nvarchar] (50) NOT NULL DEFAULT (''),
	[IsVIP] [int] NOT NULL DEFAULT(0),
	[VIPTime] [datetime] NOT NULL DEFAULT (getdate()),
	[Integral] [int] NOT NULL DEFAULT(0),
	[AdminId] [int] NOT NULL DEFAULT(0),
	[AdminName] [nvarchar] (20) NOT NULL DEFAULT (''),
	[AdminPass] [nvarchar] (32) NULL ,
	[AdminFolder] [nvarchar] (50) NOT NULL DEFAULT (''),
	[Setting] [nvarchar] (3000) NOT NULL DEFAULT (''),
	[LastTime2] [datetime] NOT NULL DEFAULT (getdate()),
	[LastIp2] [nvarchar] (15) NULL ,
	[Cookiess] [nvarchar] (10) NOT NULL DEFAULT (''),
	[MailSign] [nvarchar] (64) NULL ,
	[AdminState] [int] NOT NULL DEFAULT(0) ,
	[ForumName] [nvarchar] (20) NOT NULL DEFAULT (''),
	[ForumPass] [nvarchar] (32) NULL DEFAULT (''),
	CONSTRAINT [PK_normal_user] PRIMARY KEY CLUSTERED 
	(
		[Id]
	) ON [PRIMARY] 
) ON [PRIMARY]
GO

CREATE TABLE [jcms_normal_user_logs] (
	[Id] [int] IDENTITY (1, 1) NOT NULL ,
	[UserId] [int] NOT NULL ,
	[OperInfo] [nvarchar] (200) NOT NULL DEFAULT (''),
	[OperType] [int] NOT NULL DEFAULT(0) ,
	[OperTime] [datetime] NOT NULL DEFAULT (getdate()),
	[OperIP] [nvarchar] (15) NULL ,
	CONSTRAINT [PK_normal_user_logs] PRIMARY KEY CLUSTERED 
	(
		[Id]
	) ON [PRIMARY] 
) ON [PRIMARY]
GO

CREATE TABLE [jcms_normal_user_apply] (
	[Id] [int] IDENTITY (1, 1) NOT NULL ,
	[UserId] [int] NOT NULL ,
	[ApplyInfo] [nvarchar] (200) NOT NULL DEFAULT (''),
	[ApplyType] [int] NOT NULL DEFAULT(0) ,
	[ApplyTime] [datetime] NOT NULL DEFAULT (getdate()),
	[ApplyIP] [nvarchar] (15) NULL ,
	[MailSign] [nvarchar] (64) NULL ,
	[ApplyNumber] [int] NOT NULL DEFAULT(0) ,
	[Checked] [int] NOT NULL DEFAULT(0) ,
	CONSTRAINT [PK_normal_user_apply] PRIMARY KEY CLUSTERED 
	(
		[Id]
	) ON [PRIMARY] 
) ON [PRIMARY]
GO

CREATE TABLE [jcms_normal_user_friends] (
	[Id] [int] IDENTITY (1, 1) NOT NULL ,
	[UserId] [int] NOT NULL ,
	[AddDate] [datetime] NOT NULL DEFAULT (getdate()),
	[FriendId] [int] NOT NULL ,
	CONSTRAINT [PK_normal_user_friends] PRIMARY KEY CLUSTERED 
	(
		[Id]
	) ON [PRIMARY] 
) ON [PRIMARY]
GO

CREATE TABLE [jcms_normal_user_message] (
	[Id] [int] IDENTITY (1, 1) NOT NULL ,
	[Title] [nvarchar] (50) NOT NULL DEFAULT (''),
	[Content] [ntext] NOT NULL DEFAULT ('') ,
	[SendIP] [nvarchar] (15) NULL ,
	[SendUserId] [int] NOT NULL ,
	[ReceiveUserId] [int] NOT NULL ,
	[ReceiveUserName] [nvarchar] (20) NOT NULL DEFAULT (''),
	[AddDate] [datetime] NOT NULL DEFAULT (getdate()),
	[State] [int] NOT NULL DEFAULT(0) ,
	CONSTRAINT [PK_normal_user_message] PRIMARY KEY CLUSTERED 
	(
		[Id]
	) ON [PRIMARY] 
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO

CREATE TABLE [jcms_normal_user_favorite] (
	[Id] [int] IDENTITY (1, 1) NOT NULL ,
	[Title] [nvarchar] (150) NOT NULL ,
	[ModuleType] [nvarchar] (20) NOT NULL DEFAULT (''),
	[ChannelId] [int] NOT NULL ,
	[ContentId] [int] NOT NULL ,
	[AddDate] [datetime] NOT NULL DEFAULT (getdate()),
	[UserId] [int] NOT NULL ,
	CONSTRAINT [PK_normal_user_favorite] PRIMARY KEY CLUSTERED 
	(
		[Id]
	) ON [PRIMARY] 
) ON [PRIMARY]
GO

CREATE TABLE [jcms_normal_user_notice] (
	[Id] [int] IDENTITY (1, 1) NOT NULL ,
	[Title] [nvarchar] (50) NOT NULL DEFAULT (''),
	[Content] [nvarchar] (250) NOT NULL DEFAULT (''),
	[NoticeType] [nvarchar] (16) NULL ,
	[UserId] [int] NOT NULL ,
	[AddDate] [datetime] NOT NULL DEFAULT (getdate()),
	[State] [int] NOT NULL DEFAULT(0) ,
	CONSTRAINT [PK_normal_user_notice] PRIMARY KEY CLUSTERED 
	(
		[Id]
	) ON [PRIMARY] 
) ON [PRIMARY]
GO

CREATE TABLE [jcms_normal_usergroup] (
	[Id] [int] IDENTITY (1, 1) NOT NULL ,
	[GroupName] [nvarchar] (50) NOT NULL DEFAULT (''),
	[Setting] [nvarchar] (250) NOT NULL DEFAULT (''),
	[IsLogin] [int] NOT NULL DEFAULT(0) ,
	[UserTotal] [int] NOT NULL DEFAULT(0) ,
	CONSTRAINT [PK_normal_usergroup] PRIMARY KEY CLUSTERED 
	(
		[Id]
	) ON [PRIMARY]
) ON [PRIMARY]
GO
INSERT INTO [jcms_normal_usergroup] (GroupName,Setting,IsLogin,UserTotal) Values('临时用户','1,1,1,0|23,1,10,10,1,0,1,1,5,1,1,5,1,1,5,',1,0);
INSERT INTO [jcms_normal_usergroup] (GroupName,Setting,IsLogin,UserTotal) Values('初级用户','1,1,1,0|23,1,10,10,1,0,1,1,10,1,1,10,1,1,10,',1,0);
INSERT INTO [jcms_normal_usergroup] (GroupName,Setting,IsLogin,UserTotal) Values('中级用户','1,1,1,0|23,1,10,10,1,0,1,1,50,1,1,50,1,1,50,',1,0);
INSERT INTO [jcms_normal_usergroup] (GroupName,Setting,IsLogin,UserTotal) Values('高级用户','1,1,1,0|23,1,10,10,1,0,1,1,100,1,1,100,1,1,100,',1,0);
INSERT INTO [jcms_normal_usergroup] (GroupName,Setting,IsLogin,UserTotal) Values('管理用户','1,1,1,0|23,1,10,10,1,0,1,1,100,1,1,100,1,1,100,',1,0);